import { api } from '@/utils/request'
import type { Gift, CreateGiftRequest, UpdateGiftRequest } from '@/types/gift'

// 获取所有礼物
export const getGifts = () => {
  return api.get<Gift[]>('/gifts')
}

// 创建礼物
export const createGift = (data: CreateGiftRequest) => {
  return api.post<Gift>('/gifts', data)
}

// 更新礼物
export const updateGift = (id: number, data: UpdateGiftRequest) => {
  return api.put<Gift>(`/gifts/${id}`, data)
}

// 删除礼物
export const deleteGift = (id: number) => {
  return api.delete(`/gifts/${id}`)
}
